<!DOCTYPE html>
	<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1.0">
		<title>首页</title>
		<link rel="stylesheet" href="layui/css/layui.css">
		<link rel="stylesheet" type="text/css" href="css/footer.css">
		<link rel="stylesheet" href="https://cache.amap.com/lbs/static/main1119.css" />
		<link rel="stylesheet" type="text/css" href="css/style.css">
	</head>
	<style type="text/css">
		.layui-rate{
			     padding: 0; 
    			font-size: 0;
		}
		.layui-rate li i.layui-icon {
		    font-size: 5px;
		    color: #FFB800;
		    margin-right: 0px;
		    transition: all .3s;
		    -webkit-transition: all .3s;
		}
		.h-portrait img{
			height: 50px;
			border-radius: 100%;
		}
		.report {
			    position: absolute;
			    right: 10px;
			    top: 0;
			}
	</style>
	<body>
		<div class="select-s">
			<div>
				<div class="center select-t">
					<p>筛选</p>
					<span class="close">X</span>
				</div>
				<div class="select-b">
					<p>想看到的用户</p>
					<div class="sex">
						<div class="blue all">全部</div>
						<div class="s-girl" data-sex="女"><img src="img/female-n.png">女</div>
						<div class="s-boy" data-sex="男"><img src="img/male-n.png">男</div>
					</div>
					<!-- <div>
						<p>年龄范围</p>
					</div>
					<div class="slider"></div>
					<div class="sure center">确定</div> -->
				</div>
			</div>
		</div>
		<div class="issue">
			<ul class="flex">
		    		<li>
		    			<a href="html/i-party.html">
		    				<img src="img/party.png">
		    				<p>聚会约会</p>
		    			</a>
		    		</li>
		    		<li>
		    			<a href="html/i-travel.html">
			    			<img src="img/travel.png">
			    			<p>结伴旅游</p>
			    		</a>
		    		</li>
		    		<li>
		    			<a href="html/i-club.html">
			    			<img src="img/club.png">
			    			<p>推拿会所</p>
		    			</a>
		    		</li>
		    		<li>
		    			<a href="html/i-guide.html">
			    			<img src="img/guide.png">
			    			<p>景点商家</p>
		    			</a>
		    		</li>
		    	</ul>
		    	<div class="center issue-x"><img src="img/6d.png"></div>
		</div>
		<div style="position: fixed;width: 100%;top: 0;background:#fff;z-index: 98">
			<header class="center">
				<img src="img/beam.png">
			</header>
			<div class="flex nav" style="position: relative">
				<ul class="clearfix">
					<li class="current">附近的人</li>
					<li>附近动态</li>
					<li>附近服务</li>
				</ul>
				<img src="img/filtration.png" height="15px" class="filtrate">
				<img src="img/publish.png" class="camera" height="20px">
			</div>
		</div>
		<section style="margin-top: 90px">
			<!-- 附近的人页面 -->

			<div class="near">

				<!-- <a href="html/dynamic.html" class="underlining">
					<div class="xs">
						<div class="flex">
							<div class="h-portrait">
								<img src="img/logo.png" width="50px">
							</div>
							<div class="user">
								<p class="username">美游新号</p>
								<p class="boy flex">
									<img src="img/female-s.png" height="7px"> 23
								</p>
								<p class="wz">春风十里不如你微微一笑</p>
							</div>
							<div class="flex xs-r">0.1km</div>
						</div>
					</div>
				</a>
				<a href="html/dynamic.html" class="underlining">
					<div class="xs">
						<div class="flex">
							<div class="h-portrait">
								<img src="img/logo.png" width="50px">
							</div>
							<div class="user">
								<p class="username">出了名的难哄</p>
								<p class="girl flex">
									<img src="img/female-s.png" height="7px"> 22
								</p>
								<p class="wz">你不来，我不走</p>
							</div>
							<div class="flex xs-r">0.3km</div>
						</div>
					</div>
				</a> -->
			</div>
			<!-- 附近动态页面 -->
			<div class="content-wrap">
				<div class="film" style="z-index:99">
					<div class="center">
						<div class="film-t">
							<p>拍摄</p>
							<p>照片或视频</p>
						</div>
						<a href="html/release.html" class="underlining">
							<div class="phone-s">从手机相册选择</div>
						</a>
						<div class="parting-line"></div>
						<div class="cancle">取消</div>
					</div>
				</div>
				<div id="fujin">
					
				</div>
				<!-- <div class="content">

					<a href="html/details-infor.html" class="underlining">
						<div class="flex">
							<div class="h-portrait">
								<img src="img/logo.png" width="50px">
							</div>
							<div>
								<p class="username">小静静</p>
								<p class="girl flex">
									<img src="img/female-s.png" height="7px"> 23
								</p>
							</div>
						</div>
						<p class="wz">有在南山的朋友吗？</p>
						<div class="flex pic">
							<img src="img/logo.png">
						</div>
						<div class="flex xs-r">
							<p>0.1km</p>
							<img src="img/break.png" height="5px" class="break">
							<p>5分钟前</p>
							<img src="img/break.png" height="5px" class="break">
							<p>1080阅读</p>
						</div>
						<a href="html/report.html"><img src="img/report.png" class="report"></a>
					</a>
					<div class="flex xs-r">
						<div class="addlike">
							<img src="img/like-n.png" height="15px">
							<span>15</span>
						</div>
						<div>
							<img src="img/comment.png" height="15px">
							<span>6</span>
						</div>
						<div class="chat">
							<img src="img/chat.png" height="15px">
						</div>
					</div>
				</div>
				<div class="content">
					<a href="html/details-infor.html" class="underlining">
						<div class="flex">
							<div class="h-portrait">
								<img src="img/logo.png" width="50px">
							</div>
							<div>
								<p class="username">小静静</p>
								<p class="girl flex">
									<img src="img/female-s.png" height="7px"> 23
								</p>
							</div>
						</div>
						<p class="wz">有一起去看模特走秀的吗？</p>
						<div class="flex pic">
							<img src="img/logo.png">
						</div>
						<div class="flex xs-r">
							<p>0.8km</p>
							<img src="img/break.png" height="5px" class="break">
							<p>5分钟前</p>
							<img src="img/break.png" height="5px" class="break">
							<p>980阅读</p>
						</div>
						<a href="html/report.html"><img src="img/report.png" class="report"></a>
					</a>
					<div class="flex xs-r">
						<div class="addlike">
							<img src="img/like-n.png" height="15px">
							<span>10</span>
						</div>
						<div>
							<img src="img/comment.png" height="15px">
							<span>9</span>
						</div>
						<div class="chat">
							<img src="img/chat.png" height="15px">
						</div>
					</div>
				</div> -->
				<!-- <div class="content">
					<a href="html/details-infor.html" class="underlining">
						<div class="flex">
							<div class="h-portrait">
								<img src="img/logo.png" width="50px">
							</div>
							<div>
								<p class="username">我是你的小猫咪</p>
								<p class="girl flex">
									<img src="img/female-s.png" height="7px"> 23
								</p>
							</div>
						</div>
						<p class="wz">有人愿意来一场说走就走的旅行吗？</p>
						<div class="flex pic">
							<img src="img/logo.png">
							<img src="img/logo.png">
							<img src="img/logo.png">
							<img src="img/logo.png">
						</div>
						<div class="flex xs-r">
							<p>1.8km</p>
							<img src="img/break.png" height="5px" class="break">
							<p>9分钟前</p>
							<img src="img/break.png" height="5px" class="break">
							<p>780阅读</p>
						</div>
						<a href="html/report.html"><img src="img/report.png" class="report"></a>
					</a>
					<div class="flex xs-r">
						<div class="addlike">
							<img src="img/like-n.png" height="15px">
							<span>20</span>
						</div>
						<div>
							<img src="img/comment.png" height="15px">
							<span>18</span>
						</div>
						<div class="chat">
							<img src="img/chat.png" height="15px">
						</div>
					</div>
				</div> -->
			</div>
			<!-- 附近服务页面 -->
			<div class="service">
				<div id="banner-wrap">
					<span id="left"><</span>
					<span id="right">></span>
		    		<ul id="banner">
		    			<li><img src="img/carousel-l.png"></li>
		    			<li><img src="img/carousel-c.png"></li>
		    			<li><img src="img/carousel-r.png"></li>
		    		</ul>
		    		<ol>
		    			<li class="dot"></li>
		    			<li></li>
		    			<li></li>
		    		</ol>
		    	</div>
		    	<ul class="flex service-tab">
		    		<li>
		    			<a href="html/party.html">
		    				<img src="img/party.png">
		    				<p>聚会约会</p>
		    			</a>
		    		</li>
		    		<li>
		    			<a href="html/travel.html">
			    			<img src="img/travel.png">
			    			<p>结伴旅游</p>
			    		</a>
		    		</li>
		    		<li>
		    			<a href="html/club.html">
			    			<img src="img/club.png">
			    			<p>推拿会所</p>
		    			</a>
		    		</li>
		    		<li>
		    			<a href="html/guide.html">
			    			<img src="img/guide.png">
			    			<p>景点商家</p>
		    			</a>
		    		</li>
		    	</ul>
		    	<div class="parting-line"></div>
		    	<div class="fujingservice">
		    	<!-- 	<div class="club-wrap">
		    		<div class="flex club">
			    		<div class="h-portrait">
			    			<img src="img/logo.png" width="50px">
			    		</div>
						<div class="club-r">
							<p class="username">帝王会所</p>
							<p class="flex score">
								<img src="img/star-f.png" height="7px">
								<img src="img/star-f.png" height="7px">
								<img src="img/star-f.png" height="7px">
								<img src="img/star-f.png" height="7px">
								<img src="img/star-h.png" class="star">
								<span>4.5分</span>
							</p>
							<div class="flex distance">
								<p>按摩/足疗</p>
								<p>据我0.2km</p>
							</div>
						</div>
			    	</div>
			    	<div class="flex money">
			    		<div>
			    			<p class="blue">￥298</p>
			    			<p>门市价：<span>￥675</span></p>
			    		</div>
			    		<div>
			    			<p>单人肩部保养（70分钟）</p>
			    			<p>已售105</p>
			    		</div>
			    	</div>
		    	</div>
		    	<div class="parting-line"></div> -->
		    	</div>
			</div>
		</section>
		<footer>
			<ul class="flex center clearfix">
				<li>
					<a href="#" class="active underlining">首页</a>
				</li>
				<li>
					<a href="html/message.html" class="underlining">消息</a>
				</li>
				<li>
					<a href="#" class="fabu"></a>
				</li>
				<li>
					<a href="html/earnmoney.html"  class="underlining">赚钱</a>
				</li>
				<li>
					<a href="html/my.html"  class="underlining">我的</a>
				</li>
			</ul>
		</footer>

		<script src="js/jquery-3.3.1.js"></script>
		<script type="text/javascript" src="https://webapi.amap.com/maps?v=1.4.4&key=4f31b72d3e1631bf3b833d85cbe6d6c5"></script>
        <script type="text/javascript" src="https://cache.amap.com/lbs/static/addToolbar.js"></script>
        <script src="layui/layui.js"></script>
        <script src="layui/layui.all.js"></script>
		<script src="js/index.js"></script>
		<script src="js/my.js"></script>
	</body>
</html>
<script>
	 //是否登录
	 if(!localStorage.getItem('uPhone')){
	 	layer.msg('请先登录',{icon:5,time:1500},function(){
	 		window.location.href='html/login.html';
	 	});
	 }else{
	 	var uPhone=localStorage.getItem("uPhone");
        var uPassword=localStorage.getItem("uPassword");
	 	var wd=localStorage.getItem("wd");
        var jd=localStorage.getItem("jd");
        $.ajax({
    		url:"/meiyou/loginByphonepwd",
    		type:"POST",
    		data:"phone="+uPhone+"&pwd="+uPassword+"&jindu="+jd+"&weidu="+wd,
    		success:function(data){
    			console.log(data);
    			if(data.code==100){
    				//缓存信息
                    
    				var user = data.extend.user;
    				localStorage.setItem("uId",user.uId);
    				localStorage.setItem("uPhone",user.uPhone);
                    localStorage.setItem("uCount",user.uCount);
                    localStorage.setItem("uName",user.uName);
                    localStorage.setItem("uImg",user.uImg);
                    localStorage.setItem("uOld",user.uOld);
                    localStorage.setItem("uSex",user.uSex);
                    localStorage.setItem('umeijin',user.umeijin);
                    localStorage.setItem('qianming',user.qianming);
                    localStorage.setItem('uPassword',user.uPassword);
                   

                    
    			}
    		}
    	});
	}



	//初始状态，加载数据
	


	$('.nav ul li:nth-child(2)').click(function () {
		$('.camera').show();
		$(this).siblings().click(function () {
			$('.camera').hide();
		})
	})


		        //启动加载 
		        $(function(){
		        	/* dynamicLoading(); */
		        	
		        });
		        
		        var weidu = "";
		        var jindu = "";
		    
		        //调用高德第三方接口获取经纬度  
		        var map, geolocation;
                //加载地图，调用浏览器定位服务
                map = new AMap.Map('', {
                	resizeEnable: true
                }); 
                map.plugin('AMap.Geolocation', function() {
                	geolocation = new AMap.Geolocation({
                        enableHighAccuracy: true, //是否使用高精度定位，默认:true
                        timeout: 10000, //超过10秒后停止定位，默认：无穷大
                        buttonOffset: new AMap.Pixel(10, 20), //定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
                        zoomToAccuracy: true, //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
                        buttonPosition: 'RB'
                    });
                	map.addControl(geolocation);
                	geolocation.getCurrentPosition();
                    AMap.event.addListener(geolocation, 'complete', onComplete); //返回定位信息
                    AMap.event.addListener(geolocation, 'error', onError); //返回定位出错信息
                }); 
                //解析定位结果
                function onComplete(data) {
                	console.log(data);
                	localStorage.setItem('desc',data.formattedAddress)
                    weidu = data.position.getLat();   //纬度 
                    jindu = data.position.getLng();    //经度 
                   // alert(weidu+","+jindu);
                    // dynamicLoading(weidu,jindu);
                   
                    loadAction(weidu,jindu);
                    selservcie(weidu,jindu);
                    fjdynamic(weidu,jindu);
                }

                //解析定位错误信息
                function onError(data) {
                   // alert("定位失败");
               }

                //加载附近动态
                /*function dynamicLoading(weidu,jindu){
                	var uId = localStorage.getItem("uId");
    				var uPhone = localStorage.getItem("uPhone");
    			//	alert(uId+"||"+uPhone);
    				$.ajax({
                		url:"/meiyou/dongtai/selectdongtai",
                		type:"POST",
                		data:"jindu="+jindu+"&weidu="+weidu+"&phone="+uPhone,
                		success:function(data){
                			console.log(data);
                			if(data.code==100){
                				//显示信息
                				get_user_info(data);
                			}else{
                				//错误信息
                				
                			}
                		}
                	});
                }*/
                
                //请求获取用户信息 
               /* function get_user_info(data){
                	var list = data.extend.list;
                	$.each(list,function(i,item){
                		//查询用户信息 
                		if(item!=null){
                			var tUcount = item.tUcount;
                			//javascript:;("tUcount:"+tUcount);
                    		
                    		$.ajax({
                    			url:"/meiyou/dongtai/selectUserById",
                    			type:"POST",
                    			data:"uPhone="+tUcount,
                    			success:function(data){
                    				console.log(data);
                    				//展示信息
                    				show_user_info(item,data.extend.user);
                    			}
                    		});
                    		
                		}
                	});
                }*/
                
                //展示信息
              /*  function show_user_info(dongtai,user){
                	
                	var contentDiv = $('<div class="content"></div>');
                	//a标签
                	var a = $('<a href="html/details-infor.html?phone='+user.uPhone+'" class="underlining"></a>');
                	var flexDiv = $('<div class="flex"></div>');
                	var uImg = user.uImg;
                	var divImg = $('<div><img src="'+uImg+'" width="50px"></div>');
                	var divP = $('<div></div>');
                	var uNameP = user.uName;
                	var usernameP = $('<p class="username"></p>').append(uNameP);
                	var uOld = user.uOld;
                    var girlflexP;
                	//判断男女 
                	if(user.uSex == "男"){
                		girlflexP = $('<p class="boy flex"></p>')
                    	.append($('<img src="img/female-s.png" height="7px" />')).append(uOld);
                	}else{
                		girlflexP = $('<p class="girl flex"></p>')
                    	.append($('<img src="img/female-s.png" height="7px" />')).append(uOld);
                	}
                	
                	divP.append(usernameP).append(girlflexP);
                	var reportImg = $('<img src="img/report.png" class="report">');
                	flexDiv.append(divImg).append(divP).append(reportImg);
                	var tContent = dongtai.tContent;
                	var wzp = $('<p class="wz"></p>').append(tContent);
                	var tImgorVideo = dongtai.tImgorVideo;
                	var flexpic = $('<div class="flex pic"><img src="'+tImgorVideo+'"></div>');
                	var flexxsr = $('<div class="flex xs-r"></div>');
                    var p1 = $('<p></p>').append(dongtai.juli+"KM");        //距离  
                    var img1 = $('<img src="img/break.png" height="5px" class="break">');
                    
                    //时间字符串截取
                    var time = dongtai.time;
                    var tYuedu = dongtai.tYuedu;
                    var p2 = $('<p></p>').append(time);        //时间   
                    var img2 = $('<img src="img/break.png" height="5px" class="break">');
                    var p3 = $('<p></p>').append(tYuedu+"阅读");     //阅读  
                    flexxsr.append(p1).append(img1).append(p2).append(img2).append(p3);
                    a.append(flexDiv).append(wzp).append(flexpic).append(flexxsr);
                    
                    var flexxs = $('<div class="flex xs-r"></div>');
                    var addlike = $('<div class="addlike"></div>');
                    var addlikeImg = $('<img src="img/like-n.png" height="15px"><span></span>').append(dongtai.dianzan);
                    addlike.append(addlikeImg);
                    var div1 = $('<div></div>');
                    var Img2 = $('<img src="img/comment.png" height="15px"><span></span>').append(dongtai.pinglunshu);
                    div1.append(Img2);
                    var chatdiv = $('<div class="chat"></div>');
                    var Img2 = $('<img src="img/chat.png" height="15px">');
                    chatdiv.append(Img2);
                    flexxs.append(addlike).append(div1).append(chatdiv);
                    contentDiv.append(a).append(flexxs);
                    $('#fujin').append(contentDiv);
                }*/






                function fjdynamic(weidu,jindu){
                	var uPhone = localStorage.getItem("uPhone");
                	var uId = localStorage.getItem("uId");
    			//	alert(uId+"||"+uPhone);
    			$.ajax({
    				url:"/meiyou/dongtai/selectdongtai",
    				type:"POST",
    				data:"jindu="+jindu+"&weidu="+weidu+"&account="+uPhone+"&userId="+uId,
    				success:function(data){
    					console.log(data);
    					if(data.code==100){
                				//显示信息
                				showuser(data);

                			}else{
                				//错误信息
                				
                			}
                		}
                	});
    		}


    		function showuser(data){
    			var list = data.extend.list;
    			console.log(list);
    			$.each(list,function(i,item){
    				var uCount = item.tUcount;
    				$.post('/meiyou/dongtai/selectUserById',{uccount:uCount},function(res) {
    					var user=res.extend.user;
    					console.log(user);
    					seldynamic(item,user);					
    				});	
    			})

    		}





//查询动态
function seldynamic(dynamic,user){

if(dynamic.isdianzan==false){
	if(user.uSex=='男'){
		$('#fujin').append("<div class=\"content\" position='relative'>" +
			"<a href='html/details-infor.html?id="+dynamic.id+"' class=\"underlining\">" +
			"<div class=\"flex\">" +
			"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
			"<div>" +
			"<p class=\"username\">"+user.uName+"</p>" +
			"<p class=\"boy flex\">" +
			"<img src=\"img/male-s.png\" height=\"7px\">"+user.uOld +
			"</p>" +
			"</div>" +
			"</div>" +
			"<p class=\"wz\">"+dynamic.tContent+"</p>" +
			"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
			"</div>" +
			"<div class=\"flex xs-r\">" +
			"<p>"+dynamic.juli+"km</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.time+"</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.tYuedu+"阅读</p>" +
			"</div>" +
			"</a>" +
			"<div class=\"flex xs-r\" id='"+"a"+dynamic.id+"'>" +
			"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
			"<img src=\"img/like-n.png\" height=\"15px\">" +
			"<span>"+dynamic.dianzan+"</span>" +
			"</div>" +
			"<div>" +
			"<img src=\"img/comment.png\" height=\"15px\">" +
			"<span>"+dynamic.pinglunshu+"</span>" +
			"</div>" +
			"<div class=\"chat\">" +
			"<img src=\"img/chat.png\" height=\"15px\">" +
			"</div>" +
			"</div>" +
			"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
			"</div>");
	}else{

		$('#fujin').append("<div class=\"content\" position='relative'>" +
			"<a href='html/details-infor.html?id="+dynamic.id+"' class=\"underlining\">" +
			"<div class=\"flex\">" +
			"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
			"<div>" +
			"<p class=\"username\">"+user.uName+"</p>" +
			"<p class=\"girl flex\">" +
			"<img src=\"img/female-s.png\" height=\"7px\">"+user.uOld +
			"</p>" +
			"</div>" +
			"</div>" +
			"<p class=\"wz\">"+dynamic.tContent+"</p>" +
			"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
			"</div>" +
			"<div class=\"flex xs-r\">" +
			"<p>"+dynamic.juli+"km</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.time+"</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.tYuedu+"阅读</p>" +
			"</div>" +
			"</a>" +
			"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
			"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
			"<img src=\"img/like-n.png\" height=\"15px\">" +
			"<span>"+dynamic.dianzan+"</span>" +
			"</div>" +
			"<div>" +
			"<img src=\"img/comment.png\" height=\"15px\">" +
			"<span>"+dynamic.pinglunshu+"</span>" +
			"</div>" +
			"<div class=\"chat\">" +
			"<img src=\"img/chat.png\" height=\"15px\">" +
			"</div>" +
			"</div>" +
			"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
			"</div>");

	}
}else{
	if(user.uSex=='男'){
		$('#fujin').append("<div class=\"content\" position='relative'>" +
			"<a href='html/details-infor.html?id="+dynamic.id+"' class=\"underlining\">" +
			"<div class=\"flex\">" +
			"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
			"<div>" +
			"<p class=\"username\">"+user.uName+"</p>" +
			"<p class=\"boy flex\">" +
			"<img src=\"img/male-s.png\" height=\"7px\">"+user.uOld +
			"</p>" +
			"</div>" +
			"</div>" +
			"<p class=\"wz\">"+dynamic.tContent+"</p>" +
			"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
			"</div>" +
			"<div class=\"flex xs-r\">" +
			"<p>"+dynamic.juli+"km</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.time+"</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.tYuedu+"阅读</p>" +
			"</div>" +
			"</a>" +
			"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
			"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
			"<img src=\"img/like-s.png\" height=\"15px\">" +
			"<span>"+dynamic.dianzan+"</span>" +
			"</div>" +
			"<div>" +
			"<img src=\"img/comment.png\" height=\"15px\">" +
			"<span>"+dynamic.pinglunshu+"</span>" +
			"</div>" +
			"<div class=\"chat\">" +
			"<img src=\"img/chat.png\" height=\"15px\">" +
			"</div>" +
			"</div>" +
			"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
			"</div>");
	}else{

		$('#fujin').append("<div class=\"content\" position='relative'>" +
			"<a href='html/details-infor.html?id="+dynamic.id+"' class=\"underlining\">" +
			"<div class=\"flex\">" +
			"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
			"<div>" +
			"<p class=\"username\">"+user.uName+"</p>" +
			"<p class=\"girl flex\">" +
			"<img src=\"img/female-s.png\" height=\"7px\">"+user.uOld +
			"</p>" +
			"</div>" +
			"</div>" +
			"<p class=\"wz\">"+dynamic.tContent+"</p>" +
			"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
			"</div>" +
			"<div class=\"flex xs-r\">" +
			"<p>"+dynamic.juli+"km</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.time+"</p>" +
			"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
			"<p>"+dynamic.tYuedu+"阅读</p>" +
			"</div>" +
			"</a>" +
			"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
			"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
			"<img src=\"img/like-s.png\" height=\"15px\">" +
			"<span>"+dynamic.dianzan+"</span>" +
			"</div>" +
			"<div>" +
			"<img src=\"img/comment.png\" height=\"15px\">" +
			"<span>"+dynamic.pinglunshu+"</span>" +
			"</div>" +
			"<div class=\"chat\">" +
			"<img src=\"img/chat.png\" height=\"15px\">" +
			"</div>" +
			"</div>" +
			"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
			"</div>");

	}
}
	/*$.each(dynamic.array,function(i,img){
		$('.pic').append("<img src='"+img+"'>")
	});*/
	var id=dynamic.id;
	var img=dynamic.tImgorVideo;
	var imgs=JSON.parse(img);
	console.log(imgs);
	$.each(imgs,function(i,val){
		$('#a'+id).append("<img src='"+val+"' height='100px' width='100px'>")
	});	

}

/*附近的人*/


function loadAction(weidu,jindu){
	var phone=localStorage.getItem("uPhone");
	console.log(weidu);
	console.log(jindu);	
	$.ajax({
		type:"POST",
		url:"/meiyou/nearpesons",
		data:"jindu="+jindu+"&weidu="+weidu+"&phone="+phone,
		success:function  (data) {
			var datas=data.extend.persons;
			if (data.code==100) {
				console.log(datas);	
				$.each(datas,function(i,val){
					if(val.sex=="男"){
						$('.near').append("<a href='html/dynamic.html?ucount="+val.ucount+"' class=\"underlining\">\n" +
							"<div class=\"xs\" style='position:relative'>\n" +
							"<div class=\"flex\">\n" +
							"<div class=\"h-portrait\">\n" +
							"<img src='"+val.img+"' width=\"50px\">\n" +
							"</div>\n" +
							"<div class=\"user\">\n" +
							"<p class=\"username\">"+val.uname+"</p>\n" +
							"<p class=\"boy flex\">\n" +
							"<img src=\"img/female-s.png\" height=\"7px\"> 23\n" +
							"</p>\n" +
							"<p class=\"wz\">"+val.ucount+"</p>\n" +
							"</div>\n" +
							"<div class=\"flex xs-r\">"+val.distance+"km"+"</div>\n" +
							"</div>\n" +
							"<a href='html/report.html?id="+val.ucount+"&type=other'><img src=\"img/report.png\" height=\"15px\" class=\"report\" style='right:0;top:15px'></a>" +
							"</div>\n" +
							"</a>")
					}else{
						$('.near').append("<a href='html/dynamic.html?ucount="+val.ucount+"' class=\"underlining\">\n" +
							"<div class=\"xs\" style='position:relative'>\n" +
							"<div class=\"flex\">\n" +
							"<div class=\"h-portrait\">\n" +
							"<img src='"+val.img+"' width=\"50px\">\n" +
							"</div>\n" +
							"<div class=\"user\">\n" +
							"<p class=\"username\">"+val.uname+"</p>\n" +
							"<p class=\"girl flex\">\n" +
							"<img src=\"img/male-s.png\" height=\"7px\"> 23\n" +
							"</p>\n" +
							"<p class=\"wz\">"+val.ucount+"</p>\n" +
							"</div>\n" +
							"<div class=\"flex xs-r\">"+val.distance+"km"+"</div>\n" +
							"</div>\n" +
							"<a href='html/report.html?id="+val.ucount+"&type=other'><img src=\"img/report.png\" height=\"15px\" class=\"report\" style='right:0;top:15px'></a>" +
							"</div>\n" +
							"</a>")
					}

				})
			}else{
				console.log(data);
			}


		}
	});
}

/*点赞*/
// var sddianzan=localStorage.getItem('dongtaidianan');


	$(document).on('click','.addlike',function(){
	var fbUserId=$(this).attr('id');
	var dianzanUserId=localStorage.getItem("uId");
	var dongtaiId=$(this).parent().attr('id');
	var that=$(this);
	var isdianzan=$(this).attr('data-dianzan');
	var num=parseInt($(that).find('span').text());
	if(isdianzan=="false"){
	num=num+1;
	$(that).find('span').text(num)
	$.post('/meiyou/newPinglun/addDongtaiDianzan',{
		dongtaiId:dongtaiId,
		fbUserId:fbUserId,
		dianzanUserId:dianzanUserId
	},function(data){
		$(that).find('img').attr('src','img/like-s.png')
		console.log(data);
			layer.msg(data.msg,{icon:6,time:1000},function(){
			window.location.reload();
		})
	});
	}else{
		num=num-1;
		$(that).find('span').text(num)
		$.post('/meiyou/newPinglun/quxiaoDongtaiDianzan',{
		dongtaiId:dongtaiId,
		dianzanUserId:dianzanUserId
	},function(data){
		
		$(that).find('img').attr('src','img/like-n.png')
		console.log(data);
			layer.msg(data.msg,{icon:6,time:1000},function(){
			window.location.reload();
		})
	});

	}

});


/*$(document).ready(function(){
	if(sddianzan==1){
		$('.addlike').find('img').attr('src','img/like-n.png')
	}else{
		$('.addlike').find('img').attr('src','img/like-s.png')
	}
});*/
/*查询附近服务*/
function selservcie(weidu,jindu){
	var phone=localStorage.getItem("uPhone");
	$.ajax({
		type:"POST",
		url:"/meiyou/selService",
		data:"jindu="+jindu+"&weidu="+weidu,
		success:function  (data) {
			var datas=data.extend.list;
			if (data.code==100) {
				console.log(data);
				$.each(datas,function(i,val){
					$('.fujingservice').append("<div class=\"club-wrap\">" +
						"    <div class=\"flex club\">" +
						"    <div class=\"h-portrait\">" +
						"    <img src=\"img/logo.png\" width=\"50px\">" +
						"    </div>" +
						"<div class=\"club-r\">" +
						"<p class=\"username\">"+val.tName+"</p>" +
						"<p class=\"flex score\" id='"+val.tAssess+"'>" +
						"</p>" +
						"<div class=\"flex distance\">" +
						"<p></p>" +
						"<p>距我"+val.juli+"</p>" +
						"</div>" +
						"</div>" +
						"    </div>" +
						"    <div class=\"flex money\">" +
						"    <div>" +
						"    <p class=\"blue\">￥"+val.tMeijin+"</p>" +
						"    <p>门市价：<span>￥"+val.tMsmeijin+"</span></p>" +
						"    </div>" +
						"    <div>" +
						"    <p>"+val.tProduce+"</p>" +
						"    <p>已售"+val.tSell+"</p>" +
						"    </div>" +
						"    </div>" +
						"    </div>" +
						"    <div class=\"parting-line\"></div>")	
					var score=val.tAssess;
					layui.use(['rate'], function(){
					var rate = layui.rate;
					rate.render({
						elem: "#"+val.tAssess,
						value: score,
						half: false,
						text: true,
						readonly: true,
						setText: function(value){
							this.span.text(value+'分');
						}
					});

				});
				});
				/*var score=datas.tAssess;
				layui.use(['rate'], function(){
					var rate = layui.rate;
					rate.render({
						elem: '.score',
						value: score,
						half: true,
						text: true,
						readonly: true,
						setText: function(value){
							this.span.text(value+'分');
						}
					});

				});*/

			}else{
				console.log(data);
			}


		}
	});
}
/*筛选*/
$('.sex div:nth-child(1)').click(function(){
	window.location.reload();
})
$('.sex div').click(function(){
	var sex=$(this).attr('data-sex');
	var jindu=localStorage.getItem('jd');
	var weidu=localStorage.getItem('wd');
	var account=localStorage.getItem('uCount');
	var uId=localStorage.getItem('uId');
	console.log(sex);
	$.post('/meiyou/dongtai/selectAllDongtaiBySex',{sex:sex,jindu:jindu,weidu:weidu,account:account,userId:uId},function(data){
		console.log(data);
		$('#fujin').html('');
		$('.select-s').hide();
		shaixuanuser(data);

	});
});


function shaixuanuser(data){
	var list = data.extend.list;
	console.log(list);
	$.each(list,function(i,item){
		var uCount = item.tUcount;
		$.post('/meiyou/dongtai/selectUserById',{uccount:uCount},function(res) {
			var user=res.extend.user;
			console.log(user);
			shaixun(item,user);					
		});	
	})

}
function shaixun(dynamic,user){

	if(dynamic.isdianzan==false){
		if(user.uSex=='男'){
			$('#fujin').append("<div class=\"content\" style='position:relative'>" +
				"<a href='html/details-infor.html?id="+dynamic.id+"'+ class=\"underlining\">" +
				"<div class=\"flex\">" +
				"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
				"<div>" +
				"<p class=\"username\">"+user.uName+"</p>" +
				"<p class=\"boy flex\">" +
				"<img src=\"img/male-s.png\" height=\"7px\">"+user.uOld +
				"</p>" +
				"</div>" +
				"</div>" +
				"<p class=\"wz\">"+dynamic.tContent+"</p>" +
				"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
				"</div>" +
				"<div class=\"flex xs-r\">" +
				"<p>"+dynamic.juli+"km</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.time+"</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.tYuedu+"阅读</p>" +
				"</div>" +
				"</a>" +
				"<div class=\"flex xs-r\" id='"+"a"+dynamic.id+"'>" +
				"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
				"<img src=\"img/like-n.png\" height=\"15px\">" +
				"<span>"+dynamic.dianzan+"</span>" +
				"</div>" +
				"<div>" +
				"<img src=\"img/comment.png\" height=\"15px\">" +
				"<span>"+dynamic.pinglunshu+"</span>" +
				"</div>" +
				"<div class=\"chat\" id='"+user.uCount+"'>" +
				"<img src=\"img/chat.png\" height=\"15px\">" +
				"</div>" +
				"</div>" +
				"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
				"</div>");
		}else{

			$('#fujin').append("<div class=\"content\" style='position:relative'>" +
				"<a href='html/details-infor.html?id="+dynamic.id+"'+ class=\"underlining\">" +
				"<div class=\"flex\">" +
				"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
				"<div>" +
				"<p class=\"username\">"+user.uName+"</p>" +
				"<p class=\"girl flex\">" +
				"<img src=\"img/female-s.png\" height=\"7px\">"+user.uOld +
				"</p>" +
				"</div>" +
				"</div>" +
				"<p class=\"wz\">"+dynamic.tContent+"</p>" +
				"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
				"</div>" +
				"<div class=\"flex xs-r\">" +
				"<p>"+dynamic.juli+"km</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.time+"</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.tYuedu+"阅读</p>" +
				"</div>" +
				"</a>" +
				"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
				"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
				"<img src=\"img/like-n.png\" height=\"15px\">" +
				"<span>"+dynamic.dianzan+"</span>" +
				"</div>" +
				"<div>" +
				"<img src=\"img/comment.png\" height=\"15px\">" +
				"<span>"+dynamic.pinglunshu+"</span>" +
				"</div>" +
				"<div class=\"chat\" id='"+user.uCount+"'>" +
				"<img src=\"img/chat.png\" height=\"15px\">" +
				"</div>" +
				"</div>" +
				"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
				"</div>");

		}
	}else{
		if(user.uSex=='男'){
			$('#fujin').append("<div class=\"content\" style='position:relative;'>" +
				"<a href='html/details-infor.html?id="+dynamic.id+"'+ class=\"underlining\">" +
				"<div class=\"flex\">" +
				"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
				"<div>" +
				"<p class=\"username\">"+user.uName+"</p>" +
				"<p class=\"boy flex\">" +
				"<img src=\"img/male-s.png\" height=\"7px\">"+user.uOld +
				"</p>" +
				"</div>" +
				"</div>" +
				"<p class=\"wz\">"+dynamic.tContent+"</p>" +
				"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
				"</div>" +
				"<div class=\"flex xs-r\">" +
				"<p>"+dynamic.juli+"km</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.time+"</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.tYuedu+"阅读</p>" +
				"</div>" +
				"</a>" +
				"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
				"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
				"<img src=\"img/like-s.png\" height=\"15px\">" +
				"<span>"+dynamic.dianzan+"</span>" +
				"</div>" +
				"<div>" +
				"<img src=\"img/comment.png\" height=\"15px\">" +
				"<span>"+dynamic.pinglunshu+"</span>" +
				"</div>" +
				"<div class=\"chat\" id='"+user.uCount+"'>" +
				"<img src=\"img/chat.png\" height=\"15px\">" +
				"</div>" +
				"</div>" +
				"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
				"</div>");
		}else{

			$('#fujin').append("<div class=\"content\" position='relative'>" +
				"<a href='html/details-infor.html?id="+dynamic.id+"'+ class=\"underlining\">" +
				"<div class=\"flex\">" +
				"<div><img src='"+user.uImg+"' width=\"50px\"></div>" +
				"<div>" +
				"<p class=\"username\">"+user.uName+"</p>" +
				"<p class=\"girl flex\">" +
				"<img src=\"img/female-s.png\" height=\"7px\">"+user.uOld +
				"</p>" +
				"</div>" +
				"</div>" +
				"<p class=\"wz\">"+dynamic.tContent+"</p>" +
				"<div class=\"flex pic\" id='a"+dynamic.id+"'>" +
				"</div>" +
				"<div class=\"flex xs-r\">" +
				"<p>"+dynamic.juli+"km</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.time+"</p>" +
				"<img src=\"img/break.png\" height=\"5px\" class=\"break\">" +
				"<p>"+dynamic.tYuedu+"阅读</p>" +
				"</div>" +
				"</a>" +
				"<div class=\"flex xs-r\" id='"+dynamic.id+"'>" +
				"<div class=\"addlike\" data-dianzan='"+dynamic.isdianzan+"' id='"+user.uId+"'>" +
				"<img src=\"img/like-s.png\" height=\"15px\">" +
				"<span>"+dynamic.dianzan+"</span>" +
				"</div>" +
				"<div>" +
				"<img src=\"img/comment.png\" height=\"15px\">" +
				"<span>"+dynamic.pinglunshu+"</span>" +
				"</div>" +
				"<div class=\"chat\" id='"+user.uCount+"'>" +
				"<img src=\"img/chat.png\" height=\"15px\">" +
				"</div>" +
				"</div>" +
				"<a href='html/report.html?id="+user.uCount+"&type=dynamic'><img src=\"img/report.png\" height=\"15px\" class=\"report\"></a>" +
				"</div>");

		}
	}
	/*$.each(dynamic.array,function(i,img){
		$('.pic').append("<img src='"+img+"'>")
	});*/
	var id=dynamic.id;
	var img=dynamic.tImgorVideo;
	var imgs=JSON.parse(img);
	console.log(imgs);
	$.each(imgs,function(i,val){
		$('#a'+id).append("<img src='"+val+"' height='100px' width='100px'>")
	});	

}

 $.post('/meiyou/getSig',function(data){
     
     localStorage.setItem('userSig',data.extend.userSig);
  });

$(document).on('click','.chat',function(){

	var toUser=$(this).attr('id');
	 $.post('/meiyou/addFriend',{toUser:toUser},function(data){
        layer.msg(data.msg,{icon:6,time:1000},function(){
			window.location.href='friendsss.html';
		})
      })


});


</script>
